<script setup lang="ts">
import { ref, onMounted } from 'vue'
import BasicLayout from '@/layouts/BasicLayout.vue'
import OpeningScene from '@/components/OpeningScene.vue'

// 检查是否跳过开场动画（可以通过 localStorage 或 URL 参数控制）
const skipOpening = ref(false)

onMounted(() => {
  // 检查 URL 参数或 localStorage 来决定是否跳过开场动画
  const urlParams = new URLSearchParams(window.location.search)
  const skipParam = urlParams.get('skip-opening')
  const skipStored = localStorage.getItem('skip-opening')
  
  if (skipParam === 'true' || skipStored === 'true') {
    skipOpening.value = true
  }
})
</script>

<template>
  <OpeningScene v-if="!skipOpening" />
  <BasicLayout />
</template>

<style>
/* 全局样式优化 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
    'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}
</style>